<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-comment">{- Note: [The need for Ar.hs]
Building `-staticlib` required the presence of libtool, and was a such
restricted to mach-o only. As libtool on macOS and gnu libtool are very
different, there was no simple portable way to support this.

libtool for static archives does essentially: concatinate the input archives,
add the input objects, and create a symbol index. Using `ar` for this task
fails as even `ar` (bsd and gnu, llvm, ...) do not provide the same
features across platforms (e.g. index prefixed retrieval of objects with
the same name.)

As Archives are rather simple structurally, we can just build the archives
with Haskell directly and use ranlib on the final result to get the symbol
index. This should allow us to work around with the differences/abailability
of libtool across different platforms.
-}</span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.SysTools.Ar</span><span>
</span><span id="line-19"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier">ArchiveEntry</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-20"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier">Archive</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-21"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#afilter"><span class="hs-identifier">afilter</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#parseAr"><span class="hs-identifier">parseAr</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#loadAr"><span class="hs-identifier">loadAr</span></a></span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#loadObj"><span class="hs-identifier">loadObj</span></a></span><span>
</span><span id="line-27"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#writeBSDAr"><span class="hs-identifier">writeBSDAr</span></a></span><span>
</span><span id="line-28"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#writeGNUAr"><span class="hs-identifier">writeGNUAr</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#isBSDSymdef"><span class="hs-identifier">isBSDSymdef</span></a></span><span>
</span><span id="line-31"></span><span>  </span><span class="hs-special">,</span><span class="annot"><a href="GHC.SysTools.Ar.html#isGNUSymdef"><span class="hs-identifier">isGNUSymdef</span></a></span><span>
</span><span id="line-32"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier">mapAccumL</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#isPrefixOf"><span class="hs-identifier">isPrefixOf</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.html#"><span class="hs-identifier">Data.Binary.Get</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#"><span class="hs-identifier">Data.Binary.Put</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">C</span></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.html#"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span class="hs-cpp">
#if !defined(mingw32_HOST_OS)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">System.Posix.Files</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">POSIX</span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#takeFileName"><span class="hs-identifier">takeFileName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-keyword">data</span><span> </span><span id="ArchiveEntry"><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-var">ArchiveEntry</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ArchiveEntry"><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-var">ArchiveEntry</span></a></span></span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">{</span><span> </span><span id="filename"><span class="annot"><span class="annottext">ArchiveEntry -&gt; [Char]
</span><a href="GHC.SysTools.Ar.html#filename"><span class="hs-identifier hs-var hs-var">filename</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>       </span><span class="hs-comment">-- ^ File name.</span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="filetime"><span class="annot"><span class="annottext">ArchiveEntry -&gt; Int
</span><a href="GHC.SysTools.Ar.html#filetime"><span class="hs-identifier hs-var hs-var">filetime</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>          </span><span class="hs-comment">-- ^ File modification time.</span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="fileown"><span class="annot"><span class="annottext">ArchiveEntry -&gt; Int
</span><a href="GHC.SysTools.Ar.html#fileown"><span class="hs-identifier hs-var hs-var">fileown</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>          </span><span class="hs-comment">-- ^ File owner.</span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="filegrp"><span class="annot"><span class="annottext">ArchiveEntry -&gt; Int
</span><a href="GHC.SysTools.Ar.html#filegrp"><span class="hs-identifier hs-var hs-var">filegrp</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>          </span><span class="hs-comment">-- ^ File group.</span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="filemode"><span class="annot"><span class="annottext">ArchiveEntry -&gt; Int
</span><a href="GHC.SysTools.Ar.html#filemode"><span class="hs-identifier hs-var hs-var">filemode</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>          </span><span class="hs-comment">-- ^ File mode.</span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="filesize"><span class="annot"><span class="annottext">ArchiveEntry -&gt; Int
</span><a href="GHC.SysTools.Ar.html#filesize"><span class="hs-identifier hs-var hs-var">filesize</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>          </span><span class="hs-comment">-- ^ File size.</span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="filedata"><span class="annot"><span class="annottext">ArchiveEntry -&gt; ByteString
</span><a href="GHC.SysTools.Ar.html#filedata"><span class="hs-identifier hs-var hs-var">filedata</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-comment">-- ^ File bytes.</span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776268"><span id="local-6989586621680776277"><span class="annot"><span class="annottext">ArchiveEntry -&gt; ArchiveEntry -&gt; Bool
(ArchiveEntry -&gt; ArchiveEntry -&gt; Bool)
-&gt; (ArchiveEntry -&gt; ArchiveEntry -&gt; Bool) -&gt; Eq ArchiveEntry
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: ArchiveEntry -&gt; ArchiveEntry -&gt; Bool
$c/= :: ArchiveEntry -&gt; ArchiveEntry -&gt; Bool
== :: ArchiveEntry -&gt; ArchiveEntry -&gt; Bool
$c== :: ArchiveEntry -&gt; ArchiveEntry -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776252"><span id="local-6989586621680776254"><span id="local-6989586621680776265"><span class="annot"><span class="annottext">Int -&gt; ArchiveEntry -&gt; ShowS
[ArchiveEntry] -&gt; ShowS
ArchiveEntry -&gt; [Char]
(Int -&gt; ArchiveEntry -&gt; ShowS)
-&gt; (ArchiveEntry -&gt; [Char])
-&gt; ([ArchiveEntry] -&gt; ShowS)
-&gt; Show ArchiveEntry
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; [Char]) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [ArchiveEntry] -&gt; ShowS
$cshowList :: [ArchiveEntry] -&gt; ShowS
show :: ArchiveEntry -&gt; [Char]
$cshow :: ArchiveEntry -&gt; [Char]
showsPrec :: Int -&gt; ArchiveEntry -&gt; ShowS
$cshowsPrec :: Int -&gt; ArchiveEntry -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-keyword">newtype</span><span> </span><span id="Archive"><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-var">Archive</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Archive"><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-var">Archive</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-62"></span><span>        </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680776243"><span id="local-6989586621680776248"><span class="annot"><span class="annottext">Archive -&gt; Archive -&gt; Bool
(Archive -&gt; Archive -&gt; Bool)
-&gt; (Archive -&gt; Archive -&gt; Bool) -&gt; Eq Archive
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Archive -&gt; Archive -&gt; Bool
$c/= :: Archive -&gt; Archive -&gt; Bool
== :: Archive -&gt; Archive -&gt; Bool
$c== :: Archive -&gt; Archive -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776230"><span id="local-6989586621680776232"><span id="local-6989586621680776237"><span class="annot"><span class="annottext">Int -&gt; Archive -&gt; ShowS
[Archive] -&gt; ShowS
Archive -&gt; [Char]
(Int -&gt; Archive -&gt; ShowS)
-&gt; (Archive -&gt; [Char]) -&gt; ([Archive] -&gt; ShowS) -&gt; Show Archive
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; [Char]) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [Archive] -&gt; ShowS
$cshowList :: [Archive] -&gt; ShowS
show :: Archive -&gt; [Char]
$cshow :: Archive -&gt; [Char]
showsPrec :: Int -&gt; Archive -&gt; ShowS
$cshowsPrec :: Int -&gt; Archive -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776218"><span id="local-6989586621680776224"><span id="local-6989586621680776228"><span class="annot"><span class="annottext">NonEmpty Archive -&gt; Archive
Archive -&gt; Archive -&gt; Archive
(Archive -&gt; Archive -&gt; Archive)
-&gt; (NonEmpty Archive -&gt; Archive)
-&gt; (forall b. Integral b =&gt; b -&gt; Archive -&gt; Archive)
-&gt; Semigroup Archive
forall b. Integral b =&gt; b -&gt; Archive -&gt; Archive
forall a.
(a -&gt; a -&gt; a)
-&gt; (NonEmpty a -&gt; a)
-&gt; (forall b. Integral b =&gt; b -&gt; a -&gt; a)
-&gt; Semigroup a
stimes :: forall b. Integral b =&gt; b -&gt; Archive -&gt; Archive
$cstimes :: forall b. Integral b =&gt; b -&gt; Archive -&gt; Archive
sconcat :: NonEmpty Archive -&gt; Archive
$csconcat :: NonEmpty Archive -&gt; Archive
&lt;&gt; :: Archive -&gt; Archive -&gt; Archive
$c&lt;&gt; :: Archive -&gt; Archive -&gt; Archive
</span><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Semigroup</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776200"><span id="local-6989586621680776204"><span id="local-6989586621680776208"><span class="annot"><span class="annottext">Semigroup Archive
Archive
Semigroup Archive
-&gt; Archive
-&gt; (Archive -&gt; Archive -&gt; Archive)
-&gt; ([Archive] -&gt; Archive)
-&gt; Monoid Archive
[Archive] -&gt; Archive
Archive -&gt; Archive -&gt; Archive
forall a.
Semigroup a -&gt; a -&gt; (a -&gt; a -&gt; a) -&gt; ([a] -&gt; a) -&gt; Monoid a
mconcat :: [Archive] -&gt; Archive
$cmconcat :: [Archive] -&gt; Archive
mappend :: Archive -&gt; Archive -&gt; Archive
$cmappend :: Archive -&gt; Archive -&gt; Archive
mempty :: Archive
$cmempty :: Archive
</span><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Monoid</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="annot"><a href="GHC.SysTools.Ar.html#afilter"><span class="hs-identifier hs-type">afilter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span>
</span><span id="line-65"></span><span id="afilter"><span class="annot"><span class="annottext">afilter :: (ArchiveEntry -&gt; Bool) -&gt; Archive -&gt; Archive
</span><a href="GHC.SysTools.Ar.html#afilter"><span class="hs-identifier hs-var hs-var">afilter</span></a></span></span><span> </span><span id="local-6989586621680776195"><span class="annot"><span class="annottext">ArchiveEntry -&gt; Bool
</span><a href="#local-6989586621680776195"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span> </span><span id="local-6989586621680776194"><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776194"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ArchiveEntry] -&gt; Archive
</span><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-var">Archive</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ArchiveEntry -&gt; Bool) -&gt; [ArchiveEntry] -&gt; [ArchiveEntry]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; Bool
</span><a href="#local-6989586621680776195"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776194"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="annot"><a href="GHC.SysTools.Ar.html#isBSDSymdef"><span class="hs-identifier hs-type">isBSDSymdef</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#isGNUSymdef"><span class="hs-identifier hs-type">isGNUSymdef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-68"></span><span id="isBSDSymdef"><span class="annot"><span class="annottext">isBSDSymdef :: ArchiveEntry -&gt; Bool
</span><a href="GHC.SysTools.Ar.html#isBSDSymdef"><span class="hs-identifier hs-var hs-var">isBSDSymdef</span></a></span></span><span> </span><span id="local-6989586621680776193"><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776193"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;__.SYMDEF&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; Bool
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="../../base/src/Data.OldList.html#isPrefixOf"><span class="hs-operator hs-var">`isPrefixOf`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArchiveEntry -&gt; [Char]
</span><a href="GHC.SysTools.Ar.html#filename"><span class="hs-identifier hs-var hs-var">filename</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776193"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span id="isGNUSymdef"><span class="annot"><span class="annottext">isGNUSymdef :: ArchiveEntry -&gt; Bool
</span><a href="GHC.SysTools.Ar.html#isGNUSymdef"><span class="hs-identifier hs-var hs-var">isGNUSymdef</span></a></span></span><span> </span><span id="local-6989586621680776192"><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776192"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;/&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArchiveEntry -&gt; [Char]
</span><a href="GHC.SysTools.Ar.html#filename"><span class="hs-identifier hs-var hs-var">filename</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776192"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-comment">-- | Archives have numeric values padded with '\x20' to the right.</span><span>
</span><span id="line-72"></span><span class="annot"><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-type">getPaddedInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-73"></span><span id="getPaddedInt"><span class="annot"><span class="annottext">getPaddedInt :: ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var hs-var">getPaddedInt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall a. Read a =&gt; [Char] -&gt; a
</span><a href="../../base/src/Text.Read.html#read"><span class="hs-identifier hs-var">read</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Int) -&gt; (ByteString -&gt; [Char]) -&gt; ByteString -&gt; Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [Char])
-&gt; (ByteString -&gt; ByteString) -&gt; ByteString -&gt; [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#takeWhile"><span class="hs-identifier hs-var">C.takeWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\x20'</span></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span class="annot"><a href="GHC.SysTools.Ar.html#putPaddedInt"><span class="hs-identifier hs-type">putPaddedInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#Put"><span class="hs-identifier hs-type">Put</span></a></span><span>
</span><span id="line-76"></span><span id="putPaddedInt"><span class="annot"><span class="annottext">putPaddedInt :: Int -&gt; Int -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedInt"><span class="hs-identifier hs-var hs-var">putPaddedInt</span></a></span></span><span> </span><span id="local-6989586621680776184"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776184"><span class="hs-identifier hs-var">padding</span></a></span></span><span> </span><span id="local-6989586621680776183"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776183"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int -&gt; [Char] -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedString"><span class="hs-identifier hs-var">putPaddedString</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\x20'</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776184"><span class="hs-identifier hs-var">padding</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776183"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="annot"><a href="GHC.SysTools.Ar.html#putPaddedString"><span class="hs-identifier hs-type">putPaddedString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#Put"><span class="hs-identifier hs-type">Put</span></a></span><span>
</span><span id="line-79"></span><span id="putPaddedString"><span class="annot"><span class="annottext">putPaddedString :: Char -&gt; Int -&gt; [Char] -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedString"><span class="hs-identifier hs-var hs-var">putPaddedString</span></a></span></span><span> </span><span id="local-6989586621680776180"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776180"><span class="hs-identifier hs-var">pad</span></a></span></span><span> </span><span id="local-6989586621680776179"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776179"><span class="hs-identifier hs-var">padding</span></a></span></span><span> </span><span id="local-6989586621680776178"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776178"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putByteString"><span class="hs-identifier hs-var">putByteString</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Put) -&gt; ([Char] -&gt; ByteString) -&gt; [Char] -&gt; Put
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">C.pack</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; ByteString) -&gt; ShowS -&gt; [Char] -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ShowS
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776179"><span class="hs-identifier hs-var">padding</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Put) -&gt; [Char] -&gt; Put
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776178"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; [Char]
forall a. a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#repeat"><span class="hs-identifier hs-var">repeat</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680776180"><span class="hs-identifier hs-var">pad</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="annot"><a href="GHC.SysTools.Ar.html#getBSDArchEntries"><span class="hs-identifier hs-type">getBSDArchEntries</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-82"></span><span id="getBSDArchEntries"><span class="annot"><span class="annottext">getBSDArchEntries :: Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getBSDArchEntries"><span class="hs-identifier hs-var hs-var">getBSDArchEntries</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-83"></span><span>    </span><span id="local-6989586621680776172"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680776172"><span class="hs-identifier hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Bool
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#isEmpty"><span class="hs-identifier hs-var">isEmpty</span></a></span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680776172"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><span class="annottext">[ArchiveEntry] -&gt; Get [ArchiveEntry]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-86"></span><span>     </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-87"></span><span>        </span><span id="local-6989586621680776170"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776170"><span class="hs-identifier hs-var">name</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span>
</span><span id="line-88"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; Get () -&gt; Get ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'/'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#elem"><span class="hs-operator hs-var">`C.elem`</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776170"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#take"><span class="hs-identifier hs-var">C.take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776170"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;#1/&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Get () -&gt; Get ()) -&gt; Get () -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-89"></span><span>          </span><span class="annot"><span class="annottext">[Char] -&gt; Get ()
forall (m :: * -&gt; *) a. MonadFail m =&gt; [Char] -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Looks like GNU Archive&quot;</span></span><span>
</span><span id="line-90"></span><span>        </span><span id="local-6989586621680776164"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776164"><span class="hs-identifier hs-var">time</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span>
</span><span id="line-91"></span><span>        </span><span id="local-6989586621680776162"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776162"><span class="hs-identifier hs-var">own</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span>
</span><span id="line-92"></span><span>        </span><span id="local-6989586621680776161"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776161"><span class="hs-identifier hs-var">grp</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span>
</span><span id="line-93"></span><span>        </span><span id="local-6989586621680776160"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776160"><span class="hs-identifier hs-var">mode</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-94"></span><span>        </span><span id="local-6989586621680776159"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776159"><span class="hs-identifier hs-var">st_size</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span>
</span><span id="line-95"></span><span>        </span><span id="local-6989586621680776158"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776158"><span class="hs-identifier hs-var">end</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-96"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; Get () -&gt; Get ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776158"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;\x60\x0a&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Get () -&gt; Get ()) -&gt; Get () -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-97"></span><span>          </span><span class="annot"><span class="annottext">[Char] -&gt; Get ()
forall (m :: * -&gt; *) a. MonadFail m =&gt; [Char] -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;[BSD Archive] Invalid archive header end marker for name: &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-98"></span><span>                </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776170"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span>        </span><span id="local-6989586621680776157"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776157"><span class="hs-identifier hs-var">off1</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Int64 -&gt; Int) -&gt; Get Int64 -&gt; Get Int
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Get Int64
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#bytesRead"><span class="hs-identifier hs-var">bytesRead</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-100"></span><span>        </span><span class="hs-comment">-- BSD stores extended filenames, by writing #1/&lt;length&gt; into the</span><span>
</span><span id="line-101"></span><span>        </span><span class="hs-comment">-- name field, the first @length@ bytes then represent the file name</span><span>
</span><span id="line-102"></span><span>        </span><span class="hs-comment">-- thus the payload size is filesize + file name length.</span><span>
</span><span id="line-103"></span><span>        </span><span id="local-6989586621680776154"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776154"><span class="hs-identifier hs-var">name</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#take"><span class="hs-identifier hs-var">C.take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776170"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;#1/&quot;</span></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-104"></span><span>                        </span><span class="annot"><span class="annottext">(ByteString -&gt; [Char]) -&gt; Get ByteString -&gt; Get [Char]
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [Char])
-&gt; (ByteString -&gt; ByteString) -&gt; ByteString -&gt; [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#takeWhile"><span class="hs-identifier hs-var">C.takeWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\0'</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Get ByteString) -&gt; Int -&gt; Get ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall a. Read a =&gt; [Char] -&gt; a
</span><a href="../../base/src/Text.Read.html#read"><span class="hs-identifier hs-var">read</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Int) -&gt; [Char] -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [Char]) -&gt; ByteString -&gt; [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#drop"><span class="hs-identifier hs-var">C.drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776170"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span>                    </span><span class="hs-keyword">else</span><span>
</span><span id="line-106"></span><span>                        </span><span class="annot"><span class="annottext">[Char] -&gt; Get [Char]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Get [Char]) -&gt; [Char] -&gt; Get [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [Char]) -&gt; ByteString -&gt; [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#takeWhile"><span class="hs-identifier hs-var">C.takeWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776170"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-107"></span><span>        </span><span id="local-6989586621680776152"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776152"><span class="hs-identifier hs-var">off2</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Int64 -&gt; Int) -&gt; Get Int64 -&gt; Get Int
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Get Int64
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#bytesRead"><span class="hs-identifier hs-var">bytesRead</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-108"></span><span>        </span><span id="local-6989586621680776151"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776151"><span class="hs-identifier hs-var">file</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776159"><span class="hs-identifier hs-var">st_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776152"><span class="hs-identifier hs-var">off2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776157"><span class="hs-identifier hs-var">off1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span>        </span><span class="hs-comment">-- data sections are two byte aligned (see #15396)</span><span>
</span><span id="line-110"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; Get () -&gt; Get ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Bool
forall a. Integral a =&gt; a -&gt; Bool
</span><a href="../../base/src/GHC.Real.html#odd"><span class="hs-identifier hs-var">odd</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776159"><span class="hs-identifier hs-var">st_size</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Get () -&gt; Get ()) -&gt; Get () -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-111"></span><span>          </span><span class="annot"><span class="annottext">Get ByteString -&gt; Get ()
forall (f :: * -&gt; *) a. Functor f =&gt; f a -&gt; f ()
</span><a href="../../base/src/Data.Functor.html#void"><span class="hs-identifier hs-var">void</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span>        </span><span id="local-6989586621680776148"><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776148"><span class="hs-identifier hs-var">rest</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getBSDArchEntries"><span class="hs-identifier hs-var">getBSDArchEntries</span></a></span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><span class="annottext">[ArchiveEntry] -&gt; Get [ArchiveEntry]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([ArchiveEntry] -&gt; Get [ArchiveEntry])
-&gt; [ArchiveEntry] -&gt; Get [ArchiveEntry]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
-&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; ByteString -&gt; ArchiveEntry
</span><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-var">ArchiveEntry</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776154"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776164"><span class="hs-identifier hs-var">time</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776162"><span class="hs-identifier hs-var">own</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776161"><span class="hs-identifier hs-var">grp</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776160"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776159"><span class="hs-identifier hs-var">st_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776152"><span class="hs-identifier hs-var">off2</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776157"><span class="hs-identifier hs-var">off1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776151"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; [ArchiveEntry] -&gt; [ArchiveEntry]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776148"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="hs-comment">-- | GNU Archives feature a special '//' entry that contains the</span><span>
</span><span id="line-117"></span><span class="hs-comment">-- extended names. Those are referred to as /&lt;num&gt;, where num is the</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- offset into the '//' entry.</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- In addition, filenames are terminated with '/' in the archive.</span><span>
</span><span id="line-120"></span><span class="annot"><a href="GHC.SysTools.Ar.html#getGNUArchEntries"><span class="hs-identifier hs-type">getGNUArchEntries</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-121"></span><span id="getGNUArchEntries"><span class="annot"><span class="annottext">getGNUArchEntries :: Maybe ArchiveEntry -&gt; Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getGNUArchEntries"><span class="hs-identifier hs-var hs-var">getGNUArchEntries</span></a></span></span><span> </span><span id="local-6989586621680776146"><span class="annot"><span class="annottext">Maybe ArchiveEntry
</span><a href="#local-6989586621680776146"><span class="hs-identifier hs-var">extInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-122"></span><span>  </span><span id="local-6989586621680776145"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680776145"><span class="hs-identifier hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Bool
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#isEmpty"><span class="hs-identifier hs-var">isEmpty</span></a></span><span>
</span><span id="line-123"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680776145"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[ArchiveEntry] -&gt; Get [ArchiveEntry]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-keyword">else</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-keyword">do</span><span>
</span><span id="line-127"></span><span>      </span><span id="local-6989586621680776144"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776144"><span class="hs-identifier hs-var">name</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span>
</span><span id="line-128"></span><span>      </span><span id="local-6989586621680776143"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776143"><span class="hs-identifier hs-var">time</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span>
</span><span id="line-129"></span><span>      </span><span id="local-6989586621680776142"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776142"><span class="hs-identifier hs-var">own</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span>
</span><span id="line-130"></span><span>      </span><span id="local-6989586621680776141"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776141"><span class="hs-identifier hs-var">grp</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span>
</span><span id="line-131"></span><span>      </span><span id="local-6989586621680776140"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776140"><span class="hs-identifier hs-var">mode</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-132"></span><span>      </span><span id="local-6989586621680776139"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776139"><span class="hs-identifier hs-var">st_size</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="GHC.SysTools.Ar.html#getPaddedInt"><span class="hs-identifier hs-var">getPaddedInt</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; Get ByteString -&gt; Get Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span>
</span><span id="line-133"></span><span>      </span><span id="local-6989586621680776138"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776138"><span class="hs-identifier hs-var">end</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-134"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; Get () -&gt; Get ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776138"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;\x60\x0a&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Get () -&gt; Get ()) -&gt; Get () -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-135"></span><span>        </span><span class="annot"><span class="annottext">[Char] -&gt; Get ()
forall (m :: * -&gt; *) a. MonadFail m =&gt; [Char] -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;[BSD Archive] Invalid archive header end marker for name: &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-136"></span><span>              </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776144"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>      </span><span id="local-6989586621680776137"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776137"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776139"><span class="hs-identifier hs-var">st_size</span></a></span><span>
</span><span id="line-138"></span><span>      </span><span class="hs-comment">-- data sections are two byte aligned (see #15396)</span><span>
</span><span id="line-139"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; Get () -&gt; Get ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Bool
forall a. Integral a =&gt; a -&gt; Bool
</span><a href="../../base/src/GHC.Real.html#odd"><span class="hs-identifier hs-var">odd</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776139"><span class="hs-identifier hs-var">st_size</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Get () -&gt; Get ()) -&gt; Get () -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-140"></span><span>        </span><span class="annot"><span class="annottext">Get ByteString -&gt; Get ()
forall (f :: * -&gt; *) a. Functor f =&gt; f a -&gt; f ()
</span><a href="../../base/src/Data.Functor.html#void"><span class="hs-identifier hs-var">void</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>      </span><span id="local-6989586621680776136"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776136"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Get [Char]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Get [Char])
-&gt; (ByteString -&gt; [Char]) -&gt; ByteString -&gt; Get [Char]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Get [Char]) -&gt; ByteString -&gt; Get [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-142"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#take"><span class="hs-identifier hs-var">C.take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776144"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;/&quot;</span></span><span>
</span><span id="line-143"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#takeWhile"><span class="hs-identifier hs-var">C.takeWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776144"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-144"></span><span>               </span><span id="local-6989586621680776135"><span class="annot"><span class="annottext">name :: ByteString
</span><a href="#local-6989586621680776135"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;/&quot;</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776135"><span class="hs-identifier hs-var">name</span></a></span><span>               </span><span class="hs-comment">-- symbol table</span><span>
</span><span id="line-145"></span><span>               </span><span id="local-6989586621680776134"><span class="annot"><span class="annottext">name :: ByteString
</span><a href="#local-6989586621680776134"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;//&quot;</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776134"><span class="hs-identifier hs-var">name</span></a></span><span>               </span><span class="hs-comment">-- extendedn file names table</span><span>
</span><span id="line-146"></span><span>               </span><span id="local-6989586621680776133"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776133"><span class="hs-identifier hs-var">name</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry -&gt; Int -&gt; ByteString
</span><a href="#local-6989586621680776132"><span class="hs-identifier hs-var">getExtName</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry
</span><a href="#local-6989586621680776146"><span class="hs-identifier hs-var">extInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall a. Read a =&gt; [Char] -&gt; a
</span><a href="../../base/src/Text.Read.html#read"><span class="hs-identifier hs-var">read</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Int) -&gt; (ByteString -&gt; [Char]) -&gt; ByteString -&gt; Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Int) -&gt; ByteString -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#drop"><span class="hs-identifier hs-var">C.drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776133"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#takeWhile"><span class="hs-identifier hs-var">C.takeWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'/'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776144"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-148"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776136"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-149"></span><span>        </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;/&quot;</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry -&gt; Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getGNUArchEntries"><span class="hs-identifier hs-var">getGNUArchEntries</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry
</span><a href="#local-6989586621680776146"><span class="hs-identifier hs-var">extInfo</span></a></span><span>
</span><span id="line-150"></span><span>        </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;//&quot;</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry -&gt; Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getGNUArchEntries"><span class="hs-identifier hs-var">getGNUArchEntries</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArchiveEntry -&gt; Maybe ArchiveEntry
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
-&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; ByteString -&gt; ArchiveEntry
</span><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-var">ArchiveEntry</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776136"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776143"><span class="hs-identifier hs-var">time</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776142"><span class="hs-identifier hs-var">own</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776141"><span class="hs-identifier hs-var">grp</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776140"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776139"><span class="hs-identifier hs-var">st_size</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776137"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>        </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
-&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; ByteString -&gt; ArchiveEntry
</span><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-var">ArchiveEntry</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776136"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776143"><span class="hs-identifier hs-var">time</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776142"><span class="hs-identifier hs-var">own</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776141"><span class="hs-identifier hs-var">grp</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776140"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776139"><span class="hs-identifier hs-var">st_size</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776137"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; [ArchiveEntry] -&gt; [ArchiveEntry]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([ArchiveEntry] -&gt; [ArchiveEntry])
-&gt; Get [ArchiveEntry] -&gt; Get [ArchiveEntry]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry -&gt; Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getGNUArchEntries"><span class="hs-identifier hs-var">getGNUArchEntries</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry
</span><a href="#local-6989586621680776146"><span class="hs-identifier hs-var">extInfo</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-154"></span><span>   </span><span class="annot"><a href="#local-6989586621680776132"><span class="hs-identifier hs-type">getExtName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span>
</span><span id="line-155"></span><span>   </span><span id="local-6989586621680776132"><span class="annot"><span class="annottext">getExtName :: Maybe ArchiveEntry -&gt; Int -&gt; ByteString
</span><a href="#local-6989586621680776132"><span class="hs-identifier hs-var hs-var">getExtName</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Invalid extended filename reference.&quot;</span></span><span>
</span><span id="line-156"></span><span>   </span><span class="annot"><a href="#local-6989586621680776132"><span class="hs-identifier hs-var">getExtName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680776130"><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776130"><span class="hs-identifier hs-var">info</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680776129"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776129"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#takeWhile"><span class="hs-identifier hs-var">C.takeWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'/'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString)
-&gt; (ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#drop"><span class="hs-identifier hs-var">C.drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776129"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; ByteString
</span><a href="GHC.SysTools.Ar.html#filedata"><span class="hs-identifier hs-var hs-var">filedata</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776130"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- | put an Archive Entry. This assumes that the entries</span><span>
</span><span id="line-159"></span><span class="hs-comment">-- have been preprocessed to account for the extenden file name</span><span>
</span><span id="line-160"></span><span class="hs-comment">-- table section &quot;//&quot; e.g. for GNU Archives. Or that the names</span><span>
</span><span id="line-161"></span><span class="hs-comment">-- have been move into the payload for BSD Archives.</span><span>
</span><span id="line-162"></span><span class="annot"><a href="GHC.SysTools.Ar.html#putArchEntry"><span class="hs-identifier hs-type">putArchEntry</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#PutM"><span class="hs-identifier hs-type">PutM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span id="putArchEntry"><span class="annot"><span class="annottext">putArchEntry :: ArchiveEntry -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putArchEntry"><span class="hs-identifier hs-var hs-var">putArchEntry</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span id="local-6989586621680776127"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776127"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680776126"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776126"><span class="hs-identifier hs-var">time</span></a></span></span><span> </span><span id="local-6989586621680776125"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776125"><span class="hs-identifier hs-var">own</span></a></span></span><span> </span><span id="local-6989586621680776124"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776124"><span class="hs-identifier hs-var">grp</span></a></span></span><span> </span><span id="local-6989586621680776123"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776123"><span class="hs-identifier hs-var">mode</span></a></span></span><span> </span><span id="local-6989586621680776122"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776122"><span class="hs-identifier hs-var">st_size</span></a></span></span><span> </span><span id="local-6989586621680776121"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776121"><span class="hs-identifier hs-var">file</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-164"></span><span>  </span><span class="annot"><span class="annottext">Char -&gt; Int -&gt; [Char] -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedString"><span class="hs-identifier hs-var">putPaddedString</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span>  </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776127"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-165"></span><span>  </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedInt"><span class="hs-identifier hs-var">putPaddedInt</span></a></span><span>         </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">12</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776126"><span class="hs-identifier hs-var">time</span></a></span><span>
</span><span id="line-166"></span><span>  </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedInt"><span class="hs-identifier hs-var">putPaddedInt</span></a></span><span>          </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776125"><span class="hs-identifier hs-var">own</span></a></span><span>
</span><span id="line-167"></span><span>  </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedInt"><span class="hs-identifier hs-var">putPaddedInt</span></a></span><span>          </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776124"><span class="hs-identifier hs-var">grp</span></a></span><span>
</span><span id="line-168"></span><span>  </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedInt"><span class="hs-identifier hs-var">putPaddedInt</span></a></span><span>          </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776123"><span class="hs-identifier hs-var">mode</span></a></span><span>
</span><span id="line-169"></span><span>  </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putPaddedInt"><span class="hs-identifier hs-var">putPaddedInt</span></a></span><span>         </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776122"><span class="hs-identifier hs-var">st_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776119"><span class="hs-identifier hs-var">pad</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>  </span><span class="annot"><span class="annottext">ByteString -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putByteString"><span class="hs-identifier hs-var">putByteString</span></a></span><span>           </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;\x60\x0a&quot;</span></span><span>
</span><span id="line-171"></span><span>  </span><span class="annot"><span class="annottext">ByteString -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putByteString"><span class="hs-identifier hs-var">putByteString</span></a></span><span>           </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776121"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-172"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Put -&gt; Put
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776119"><span class="hs-identifier hs-var">pad</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Put -&gt; Put) -&gt; Put -&gt; Put
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-173"></span><span>    </span><span class="annot"><span class="annottext">Word8 -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putWord8"><span class="hs-identifier hs-var">putWord8</span></a></span><span>              </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x0a</span></span><span>
</span><span id="line-174"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-175"></span><span>    </span><span id="local-6989586621680776119"><span class="annot"><span class="annottext">pad :: Int
</span><a href="#local-6989586621680776119"><span class="hs-identifier hs-var hs-var">pad</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776122"><span class="hs-identifier hs-var">st_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#mod"><span class="hs-operator hs-var">`mod`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="annot"><a href="GHC.SysTools.Ar.html#getArchMagic"><span class="hs-identifier hs-type">getArchMagic</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span id="getArchMagic"><span class="annot"><span class="annottext">getArchMagic :: Get ()
</span><a href="GHC.SysTools.Ar.html#getArchMagic"><span class="hs-identifier hs-var hs-var">getArchMagic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-179"></span><span>  </span><span id="local-6989586621680776113"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776113"><span class="hs-identifier hs-var">magic</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [Char]) -&gt; Get ByteString -&gt; Get [Char]
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">C.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">(Get ByteString -&gt; Get [Char]) -&gt; Get ByteString -&gt; Get [Char]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-180"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776113"><span class="hs-identifier hs-var">magic</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;!&lt;arch&gt;\n&quot;</span></span><span>
</span><span id="line-181"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Get ()
forall (m :: * -&gt; *) a. MonadFail m =&gt; [Char] -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; Get ()) -&gt; [Char] -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Invalid magic number &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ShowS
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776113"><span class="hs-identifier hs-var">magic</span></a></span><span>
</span><span id="line-182"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">() -&gt; Get ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span class="annot"><a href="GHC.SysTools.Ar.html#putArchMagic"><span class="hs-identifier hs-type">putArchMagic</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#Put"><span class="hs-identifier hs-type">Put</span></a></span><span>
</span><span id="line-185"></span><span id="putArchMagic"><span class="annot"><span class="annottext">putArchMagic :: Put
</span><a href="GHC.SysTools.Ar.html#putArchMagic"><span class="hs-identifier hs-var hs-var">putArchMagic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putByteString"><span class="hs-identifier hs-var">putByteString</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Put) -&gt; ByteString -&gt; Put
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">C.pack</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;!&lt;arch&gt;\n&quot;</span></span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.SysTools.Ar.html#getArch"><span class="hs-identifier hs-type">getArch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span>
</span><span id="line-188"></span><span id="getArch"><span class="annot"><span class="annottext">getArch :: Get Archive
</span><a href="GHC.SysTools.Ar.html#getArch"><span class="hs-identifier hs-var hs-var">getArch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ArchiveEntry] -&gt; Archive
</span><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-var">Archive</span></a></span><span> </span><span class="annot"><span class="annottext">([ArchiveEntry] -&gt; Archive) -&gt; Get [ArchiveEntry] -&gt; Get Archive
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-189"></span><span>  </span><span class="annot"><span class="annottext">Get ()
</span><a href="GHC.SysTools.Ar.html#getArchMagic"><span class="hs-identifier hs-var">getArchMagic</span></a></span><span>
</span><span id="line-190"></span><span>  </span><span class="annot"><span class="annottext">Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getBSDArchEntries"><span class="hs-identifier hs-var">getBSDArchEntries</span></a></span><span> </span><span class="annot"><span class="annottext">Get [ArchiveEntry] -&gt; Get [ArchiveEntry] -&gt; Get [ArchiveEntry]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry -&gt; Get [ArchiveEntry]
</span><a href="GHC.SysTools.Ar.html#getGNUArchEntries"><span class="hs-identifier hs-var">getGNUArchEntries</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ArchiveEntry
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span class="annot"><a href="GHC.SysTools.Ar.html#putBSDArch"><span class="hs-identifier hs-type">putBSDArch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#PutM"><span class="hs-identifier hs-type">PutM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span id="putBSDArch"><span class="annot"><span class="annottext">putBSDArch :: Archive -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putBSDArch"><span class="hs-identifier hs-var hs-var">putBSDArch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span> </span><span id="local-6989586621680776108"><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776108"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-194"></span><span>  </span><span class="annot"><span class="annottext">Put
</span><a href="GHC.SysTools.Ar.html#putArchMagic"><span class="hs-identifier hs-var">putArchMagic</span></a></span><span>
</span><span id="line-195"></span><span>  </span><span class="annot"><span class="annottext">(ArchiveEntry -&gt; Put) -&gt; [ArchiveEntry] -&gt; Put
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putArchEntry"><span class="hs-identifier hs-var">putArchEntry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ArchiveEntry] -&gt; [ArchiveEntry]
</span><a href="#local-6989586621680776106"><span class="hs-identifier hs-var">processEntries</span></a></span><span> </span><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776108"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-198"></span><span>    </span><span id="local-6989586621680776104"><span class="annot"><span class="annottext">padStr :: a -&gt; Int -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621680776104"><span class="hs-identifier hs-var hs-var">padStr</span></a></span></span><span> </span><span id="local-6989586621680776103"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776103"><span class="hs-identifier hs-var">pad</span></a></span></span><span> </span><span id="local-6989586621680776102"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776102"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span id="local-6989586621680776101"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680776101"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [a] -&gt; [a]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776102"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [a]) -&gt; [a] -&gt; [a]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680776101"><span class="hs-identifier hs-var">str</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a]
forall a. a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#repeat"><span class="hs-identifier hs-var">repeat</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680776103"><span class="hs-identifier hs-var">pad</span></a></span><span>
</span><span id="line-199"></span><span>    </span><span id="local-6989586621680776088"><span class="annot"><span class="annottext">nameSize :: t a -&gt; Int
</span><a href="#local-6989586621680776088"><span class="hs-identifier hs-var hs-var">nameSize</span></a></span></span><span> </span><span id="local-6989586621680776087"><span class="annot"><span class="annottext">t a
</span><a href="#local-6989586621680776087"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">t a -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">t a
</span><a href="#local-6989586621680776087"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; (Int, Int)
forall a. Integral a =&gt; a -&gt; a -&gt; (a, a)
</span><a href="../../base/src/GHC.Real.html#divMod"><span class="hs-operator hs-var">`divMod`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-200"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621680776084"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776084"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776084"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-201"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621680776082"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776082"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776082"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-202"></span><span>    </span><span id="local-6989586621680776075"><span class="annot"><span class="annottext">needExt :: t Char -&gt; Bool
</span><a href="#local-6989586621680776075"><span class="hs-identifier hs-var hs-var">needExt</span></a></span></span><span> </span><span id="local-6989586621680776074"><span class="annot"><span class="annottext">t Char
</span><a href="#local-6989586621680776074"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t Char -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">t Char
</span><a href="#local-6989586621680776074"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; t Char -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">t Char
</span><a href="#local-6989586621680776074"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-203"></span><span>    </span><span class="annot"><a href="#local-6989586621680776070"><span class="hs-identifier hs-type">processEntry</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span>
</span><span id="line-204"></span><span>    </span><span id="local-6989586621680776070"><span class="annot"><span class="annottext">processEntry :: ArchiveEntry -&gt; ArchiveEntry
</span><a href="#local-6989586621680776070"><span class="hs-identifier hs-var hs-var">processEntry</span></a></span></span><span> </span><span id="local-6989586621680776069"><span class="annot"><span class="annottext">archive :: ArchiveEntry
</span><a href="#local-6989586621680776069"><span class="hs-identifier hs-var">archive</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span id="local-6989586621680776068"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776068"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680776067"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776067"><span class="hs-identifier hs-var">st_size</span></a></span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-205"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Bool
forall {t :: * -&gt; *}. Foldable t =&gt; t Char -&gt; Bool
</span><a href="#local-6989586621680776075"><span class="hs-identifier hs-var">needExt</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776068"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776069"><span class="hs-identifier hs-var">archive</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">filename :: [Char]
</span><a href="GHC.SysTools.Ar.html#filename"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;#1/&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776066"><span class="hs-identifier hs-var">sz</span></a></span><span>
</span><span id="line-206"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">filedata :: ByteString
</span><a href="GHC.SysTools.Ar.html#filedata"><span class="hs-identifier hs-var">filedata</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">C.pack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int -&gt; ShowS
forall {a}. a -&gt; Int -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621680776104"><span class="hs-identifier hs-var">padStr</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\0'</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776066"><span class="hs-identifier hs-var">sz</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776068"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; ByteString
</span><a href="GHC.SysTools.Ar.html#filedata"><span class="hs-identifier hs-var hs-var">filedata</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776069"><span class="hs-identifier hs-var">archive</span></a></span><span>
</span><span id="line-207"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">filesize :: Int
</span><a href="GHC.SysTools.Ar.html#filesize"><span class="hs-identifier hs-var">filesize</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776067"><span class="hs-identifier hs-var">st_size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776066"><span class="hs-identifier hs-var">sz</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-208"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776069"><span class="hs-identifier hs-var">archive</span></a></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680776066"><span class="annot"><span class="annottext">sz :: Int
</span><a href="#local-6989586621680776066"><span class="hs-identifier hs-var hs-var">sz</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall {t :: * -&gt; *} {a}. Foldable t =&gt; t a -&gt; Int
</span><a href="#local-6989586621680776088"><span class="hs-identifier hs-var">nameSize</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776068"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span>    </span><span id="local-6989586621680776106"><span class="annot"><span class="annottext">processEntries :: [ArchiveEntry] -&gt; [ArchiveEntry]
</span><a href="#local-6989586621680776106"><span class="hs-identifier hs-var hs-var">processEntries</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ArchiveEntry -&gt; ArchiveEntry) -&gt; [ArchiveEntry] -&gt; [ArchiveEntry]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; ArchiveEntry
</span><a href="#local-6989586621680776070"><span class="hs-identifier hs-var">processEntry</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="annot"><a href="GHC.SysTools.Ar.html#putGNUArch"><span class="hs-identifier hs-type">putGNUArch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#PutM"><span class="hs-identifier hs-type">PutM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-215"></span><span id="putGNUArch"><span class="annot"><span class="annottext">putGNUArch :: Archive -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putGNUArch"><span class="hs-identifier hs-var hs-var">putGNUArch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span> </span><span id="local-6989586621680776063"><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776063"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-216"></span><span>  </span><span class="annot"><span class="annottext">Put
</span><a href="GHC.SysTools.Ar.html#putArchMagic"><span class="hs-identifier hs-var">putArchMagic</span></a></span><span>
</span><span id="line-217"></span><span>  </span><span class="annot"><span class="annottext">(ArchiveEntry -&gt; Put) -&gt; [ArchiveEntry] -&gt; Put
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putArchEntry"><span class="hs-identifier hs-var">putArchEntry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ArchiveEntry] -&gt; [ArchiveEntry]
</span><a href="#local-6989586621680776062"><span class="hs-identifier hs-var">processEntries</span></a></span><span> </span><span class="annot"><span class="annottext">[ArchiveEntry]
</span><a href="#local-6989586621680776063"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-220"></span><span>    </span><span class="annot"><a href="#local-6989586621680776061"><span class="hs-identifier hs-type">processEntry</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span>    </span><span id="local-6989586621680776061"><span class="annot"><span class="annottext">processEntry :: ArchiveEntry -&gt; ArchiveEntry -&gt; (ArchiveEntry, ArchiveEntry)
</span><a href="#local-6989586621680776061"><span class="hs-identifier hs-var hs-var">processEntry</span></a></span></span><span> </span><span id="local-6989586621680776060"><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776060"><span class="hs-identifier hs-var">extInfo</span></a></span></span><span> </span><span id="local-6989586621680776059"><span class="annot"><span class="annottext">archive :: ArchiveEntry
</span><a href="#local-6989586621680776059"><span class="hs-identifier hs-var">archive</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span> </span><span id="local-6989586621680776058"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776058"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776058"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">15</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776060"><span class="hs-identifier hs-var">extInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">filesize :: Int
</span><a href="GHC.SysTools.Ar.html#filesize"><span class="hs-identifier hs-var">filesize</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; Int
</span><a href="GHC.SysTools.Ar.html#filesize"><span class="hs-identifier hs-var hs-var">filesize</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776060"><span class="hs-identifier hs-var">extInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776058"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-223"></span><span>                                    </span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">filedata :: ByteString
</span><a href="GHC.SysTools.Ar.html#filedata"><span class="hs-identifier hs-var">filedata</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; ByteString
</span><a href="GHC.SysTools.Ar.html#filedata"><span class="hs-identifier hs-var hs-var">filedata</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776060"><span class="hs-identifier hs-var">extInfo</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>  </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">C.pack</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776058"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;/\n&quot;</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-224"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776059"><span class="hs-identifier hs-var">archive</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">filename :: [Char]
</span><a href="GHC.SysTools.Ar.html#filename"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;/&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ArchiveEntry -&gt; Int
</span><a href="GHC.SysTools.Ar.html#filesize"><span class="hs-identifier hs-var hs-var">filesize</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776060"><span class="hs-identifier hs-var">extInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776060"><span class="hs-identifier hs-var">extInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ArchiveEntry
</span><a href="#local-6989586621680776059"><span class="hs-identifier hs-var">archive</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">filename :: [Char]
</span><a href="GHC.SysTools.Ar.html#filename"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776058"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ShowS
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;/&quot;</span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span>    </span><span class="annot"><a href="#local-6989586621680776062"><span class="hs-identifier hs-type">processEntries</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-228"></span><span>    </span><span id="local-6989586621680776062"><span class="annot"><span class="annottext">processEntries :: [ArchiveEntry] -&gt; [ArchiveEntry]
</span><a href="#local-6989586621680776062"><span class="hs-identifier hs-var hs-var">processEntries</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-229"></span><span>      </span><span class="annot"><span class="annottext">(ArchiveEntry -&gt; [ArchiveEntry] -&gt; [ArchiveEntry])
-&gt; (ArchiveEntry, [ArchiveEntry]) -&gt; [ArchiveEntry]
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((ArchiveEntry, [ArchiveEntry]) -&gt; [ArchiveEntry])
-&gt; ([ArchiveEntry] -&gt; (ArchiveEntry, [ArchiveEntry]))
-&gt; [ArchiveEntry]
-&gt; [ArchiveEntry]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ArchiveEntry -&gt; ArchiveEntry -&gt; (ArchiveEntry, ArchiveEntry))
-&gt; ArchiveEntry -&gt; [ArchiveEntry] -&gt; (ArchiveEntry, [ArchiveEntry])
forall (t :: * -&gt; *) s a b.
Traversable t =&gt;
(s -&gt; a -&gt; (s, b)) -&gt; s -&gt; t a -&gt; (s, t b)
</span><a href="../../base/src/Data.Traversable.html#mapAccumL"><span class="hs-identifier hs-var">mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; ArchiveEntry -&gt; (ArchiveEntry, ArchiveEntry)
</span><a href="#local-6989586621680776061"><span class="hs-identifier hs-var">processEntry</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char]
-&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; ByteString -&gt; ArchiveEntry
</span><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-var">ArchiveEntry</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;//&quot;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">ByteString
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span class="annot"><a href="GHC.SysTools.Ar.html#parseAr"><span class="hs-identifier hs-type">parseAr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">B.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span>
</span><span id="line-232"></span><span id="parseAr"><span class="annot"><span class="annottext">parseAr :: ByteString -&gt; Archive
</span><a href="GHC.SysTools.Ar.html#parseAr"><span class="hs-identifier hs-var hs-var">parseAr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get Archive -&gt; ByteString -&gt; Archive
forall a. Get a -&gt; ByteString -&gt; a
</span><a href="../../binary/src/Data.Binary.Get.html#runGet"><span class="hs-identifier hs-var">runGet</span></a></span><span> </span><span class="annot"><span class="annottext">Get Archive
</span><a href="GHC.SysTools.Ar.html#getArch"><span class="hs-identifier hs-var">getArch</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Archive)
-&gt; (ByteString -&gt; ByteString) -&gt; ByteString -&gt; Archive
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#fromChunks"><span class="hs-identifier hs-var">L.fromChunks</span></a></span><span> </span><span class="annot"><span class="annottext">([ByteString] -&gt; ByteString)
-&gt; (ByteString -&gt; [ByteString]) -&gt; ByteString -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [ByteString]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="annot"><a href="GHC.SysTools.Ar.html#writeBSDAr"><span class="hs-identifier hs-type">writeBSDAr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#writeGNUAr"><span class="hs-identifier hs-type">writeGNUAr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span id="writeBSDAr"><span class="annot"><span class="annottext">writeBSDAr :: [Char] -&gt; Archive -&gt; IO ()
</span><a href="GHC.SysTools.Ar.html#writeBSDAr"><span class="hs-identifier hs-var hs-var">writeBSDAr</span></a></span></span><span> </span><span id="local-6989586621680776053"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776053"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString -&gt; IO ()
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#writeFile"><span class="hs-identifier hs-var">L.writeFile</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776053"><span class="hs-identifier hs-var">fp</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; IO ())
-&gt; (Archive -&gt; ByteString) -&gt; Archive -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Put -&gt; ByteString
</span><a href="../../binary/src/Data.Binary.Put.html#runPut"><span class="hs-identifier hs-var">runPut</span></a></span><span> </span><span class="annot"><span class="annottext">(Put -&gt; ByteString) -&gt; (Archive -&gt; Put) -&gt; Archive -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Archive -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putBSDArch"><span class="hs-identifier hs-var">putBSDArch</span></a></span><span>
</span><span id="line-236"></span><span id="writeGNUAr"><span class="annot"><span class="annottext">writeGNUAr :: [Char] -&gt; Archive -&gt; IO ()
</span><a href="GHC.SysTools.Ar.html#writeGNUAr"><span class="hs-identifier hs-var hs-var">writeGNUAr</span></a></span></span><span> </span><span id="local-6989586621680776050"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776050"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ByteString -&gt; IO ()
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#writeFile"><span class="hs-identifier hs-var">L.writeFile</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776050"><span class="hs-identifier hs-var">fp</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; IO ())
-&gt; (Archive -&gt; ByteString) -&gt; Archive -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Put -&gt; ByteString
</span><a href="../../binary/src/Data.Binary.Put.html#runPut"><span class="hs-identifier hs-var">runPut</span></a></span><span> </span><span class="annot"><span class="annottext">(Put -&gt; ByteString) -&gt; (Archive -&gt; Put) -&gt; Archive -&gt; ByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Archive -&gt; Put
</span><a href="GHC.SysTools.Ar.html#putGNUArch"><span class="hs-identifier hs-var">putGNUArch</span></a></span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span class="annot"><a href="GHC.SysTools.Ar.html#loadAr"><span class="hs-identifier hs-type">loadAr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#Archive"><span class="hs-identifier hs-type">Archive</span></a></span><span>
</span><span id="line-239"></span><span id="loadAr"><span class="annot"><span class="annottext">loadAr :: [Char] -&gt; IO Archive
</span><a href="GHC.SysTools.Ar.html#loadAr"><span class="hs-identifier hs-var hs-var">loadAr</span></a></span></span><span> </span><span id="local-6989586621680776049"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776049"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Archive
</span><a href="GHC.SysTools.Ar.html#parseAr"><span class="hs-identifier hs-var">parseAr</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; Archive) -&gt; IO ByteString -&gt; IO Archive
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#readFile"><span class="hs-identifier hs-var">B.readFile</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776049"><span class="hs-identifier hs-var">fp</span></a></span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="annot"><a href="GHC.SysTools.Ar.html#loadObj"><span class="hs-identifier hs-type">loadObj</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-type">ArchiveEntry</span></a></span><span>
</span><span id="line-242"></span><span id="loadObj"><span class="annot"><span class="annottext">loadObj :: [Char] -&gt; IO ArchiveEntry
</span><a href="GHC.SysTools.Ar.html#loadObj"><span class="hs-identifier hs-var hs-var">loadObj</span></a></span></span><span> </span><span id="local-6989586621680776047"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776047"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-243"></span><span>  </span><span id="local-6989586621680776046"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776046"><span class="hs-identifier hs-var">payload</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#readFile"><span class="hs-identifier hs-var">B.readFile</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776047"><span class="hs-identifier hs-var">fp</span></a></span><span>
</span><span id="line-244"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621680776045"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776045"><span class="hs-identifier hs-var">modt</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776044"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776044"><span class="hs-identifier hs-var">own</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776043"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776043"><span class="hs-identifier hs-var">grp</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680776042"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776042"><span class="hs-identifier hs-var">mode</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO (Int, Int, Int, Int)
</span><a href="GHC.SysTools.Ar.html#fileInfo"><span class="hs-identifier hs-var">fileInfo</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776047"><span class="hs-identifier hs-var">fp</span></a></span><span>
</span><span id="line-245"></span><span>  </span><span class="annot"><span class="annottext">ArchiveEntry -&gt; IO ArchiveEntry
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(ArchiveEntry -&gt; IO ArchiveEntry)
-&gt; ArchiveEntry -&gt; IO ArchiveEntry
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
-&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; ByteString -&gt; ArchiveEntry
</span><a href="GHC.SysTools.Ar.html#ArchiveEntry"><span class="hs-identifier hs-var">ArchiveEntry</span></a></span><span>
</span><span id="line-246"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeFileName"><span class="hs-identifier hs-var">takeFileName</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621680776047"><span class="hs-identifier hs-var">fp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776045"><span class="hs-identifier hs-var">modt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776044"><span class="hs-identifier hs-var">own</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776043"><span class="hs-identifier hs-var">grp</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680776042"><span class="hs-identifier hs-var">mode</span></a></span><span>
</span><span id="line-247"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">B.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776046"><span class="hs-identifier hs-var">payload</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680776046"><span class="hs-identifier hs-var">payload</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- | Take a filePath and return (mod time, own, grp, mode in decimal)</span><span>
</span><span id="line-250"></span><span class="annot"><a href="GHC.SysTools.Ar.html#fileInfo"><span class="hs-identifier hs-type">fileInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ mod time, own, grp, mode (in decimal)</span><span class="hs-cpp">
#if defined(mingw32_HOST_OS)
</span><span class="hs-comment">-- on windows mod time, owner group and mode are zero.</span><span>
</span><span id="line-253"></span><span id="fileInfo"><span class="annot"><span class="annottext">fileInfo :: [Char] -&gt; IO (Int, Int, Int, Int)
</span><a href="GHC.SysTools.Ar.html#fileInfo"><span class="hs-identifier hs-var hs-var">fileInfo</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int, Int, Int, Int) -&gt; IO (Int, Int, Int, Int)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span class="hs-identifier">fileInfo</span><span> </span><span class="hs-identifier">fp</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">go</span><span> </span><span class="hs-operator">&lt;$&gt;</span><span> </span><span class="hs-identifier">POSIX.getFileStatus</span><span> </span><span class="hs-identifier">fp</span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-identifier">go</span><span> </span><span class="hs-identifier">status</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">fromEnum</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">POSIX.modificationTime</span><span> </span><span class="hs-identifier">status</span><span>
</span><span id="line-257"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">POSIX.fileOwner</span><span> </span><span class="hs-identifier">status</span><span>
</span><span id="line-258"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">POSIX.fileGroup</span><span> </span><span class="hs-identifier">status</span><span>
</span><span id="line-259"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">oct2dec</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">POSIX.fileMode</span><span> </span><span class="hs-identifier">status</span><span>
</span><span id="line-260"></span><span>                    </span><span class="hs-special">)</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="hs-identifier">oct2dec</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Int</span><span>
</span><span id="line-263"></span><span class="hs-identifier">oct2dec</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">foldl'</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">a</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-operator">*</span><span> </span><span class="hs-number">10</span><span> </span><span class="hs-operator">+</span><span> </span><span class="hs-identifier">b</span><span class="hs-special">)</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">reverse</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">dec</span><span> </span><span class="hs-number">8</span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-identifier">dec</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-265"></span><span>        </span><span class="hs-identifier">dec</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rest</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">last</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">quotRem</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">b</span><span>
</span><span id="line-266"></span><span>                  </span><span class="hs-keyword">in</span><span> </span><span class="hs-identifier">last</span><span class="hs-glyph">:</span><span class="hs-identifier">dec</span><span> </span><span class="hs-identifier">b</span><span> </span><span class="hs-identifier">rest</span><span class="hs-cpp">

#endif
</span></pre></body></html>